package com.example.mapp;

import com.example.entity.authority.SysRoleAuthor;
import com.example.ext.entity.ExtSystemRole;
import org.apache.ibatis.annotations.*;

/**
 * Created by youkun on 2017/8/13.
 */
@Mapper
public interface SysRoleAuthorMapp {

    @Delete("delete from sys_role_author where author_id = #{id}")
    public int deleteSysRoleAuthorByAuthorId(@Param("id") String id)throws Exception;

    @Delete("delete from sys_role_author where role_id=#{id}")
    public int deleteSysRoleAuthorByRoleId(@Param("id") String id) throws Exception;

    @Insert(" insert into sys_role_author (role_id,author_id) value (#{roleId},#{authorId})")
    @SelectKey(statement="select last_insert_id()",keyProperty = "id",keyColumn = "id",before = false,resultType = Long.class)
    public int add(SysRoleAuthor systemRole) throws Exception;

}
